import { readSync } from 'node-yaml'
import { get } from 'lodash'
import { AutoWired, Singleton } from 'typescript-ioc'

// @AutoWired
@Singleton
export class ConfigService {
  private readonly config

  constructor() {
    this.config = readSync('../../config.yml')
  }

  get(key: string, defaultValue?): any {
    return get(this.config, key, defaultValue)
  }
}
